package com.br.sae.model.dao;

import java.util.List;

import javax.persistence.Query;

import com.br.sae.conexaobd.SistemaDAO;
import com.br.sae.model.entitys.DisciplinaProfessor;

public class DisciplinaProfessorBD {
	
	public List<DisciplinaProfessor> consultaDisciplinaProfessor(){
		String sql = "SELECT disciplinaProfessor FROM DisciplinaProfessor disciplinaProfessor";
		Query query = SistemaDAO.createQuery(sql);
		return query.getResultList();		
	}
	
	
	public boolean incluirDisciplinaProfessor(DisciplinaProfessor disciplinaProfessor){
        try{
            SistemaDAO.persistDisciplinaProfessor(disciplinaProfessor);
            return true;
        }catch(Exception e){
            e.printStackTrace();
        }
        return false;
    }
    
    public boolean alterarDisciplinaProfessor(DisciplinaProfessor disciplinaProfessor){
        try{
            SistemaDAO.updateDisciplinaProfessor(disciplinaProfessor);
            return true;
        }catch(Exception e){
            e.printStackTrace();
        }
        return false;
    }
    
    public boolean removerDisciplinaProfessor(DisciplinaProfessor disciplinaProfessor){
        try{
            SistemaDAO.removerDisciplinaProfessor(disciplinaProfessor);
            return true;
        }catch(Exception e){
            e.printStackTrace();
        }
        return false;
    }

	
}
